import request from './request'
// 各种API
export default {
    // MV的地址
    async mvUrl(params) {
        const { data: ret } = await request({ url: 'mv/url', params })
        return ret
    },
    // 相似MV
    async simiMv(params) {
        const { data: ret } = await request({ url: 'simi/mv', params })
        return ret
    },
    // MV基础信息
    async mvDetail(params) {
        const { data: ret } = await request({ url: 'mv/detail', params })
        return ret
    },
    // 获取歌手详情
    async arDetail(params) {
        const { data: ret } = await request({ url: 'artist/detail', params })
        return ret
    },
    // 获取专辑
    async album(params) {
        const { data: ret } = await request({ url: 'album', params })
        return ret
    },
    // 歌曲播放路径
    async songUrl(params) {
        const { data: ret } = await request({ url: 'song/url', params })
        return ret
    },
    // 获取所有歌曲详情
    async trackAll(params) {
        const { data: ret } = await request({ url: 'playlist/track/all', params })
        return ret
    },
    // 获取专辑评论
    async comAl(params) {
        const { data: ret } = await request({ url: 'comment/album', params })
        return ret
    },
    // 发送评论
    async sendComment(params) {
        const { data: ret } = await request({ url: 'comment?t=1', params })
        return ret
    },
    // 回复评论
    async resComment(params) {
        const { data: ret } = await request({ url: 'comment?t=2', params })
        return ret
    },
    // 获取热门50首歌曲
    async topSong(params) {
        const { data: ret } = await request({ url: 'artist/top/song', params })
        return ret
    },
    // 获取歌手专辑
    async getAlbum(params) {
        const { data: ret } = await request({ url: 'artist/album', params })
        return ret
    },
    // 收藏歌手
    async subArt(params) {
        const { data: ret } = await request({ url: 'artist/sub', params })
        return ret
    },
    // 查看收藏的歌手列表
    async subArList(params) {
        const { data: ret } = await request({ url: 'artist/sublist', params })
        return ret
    },
    // 获取歌手MV
    async artistMv(params) {
        const { data: ret } = await request({ url: 'artist/mv', params })
        return ret
    },
    // 获取相似歌手
    async simiArt(params) {
        const { data: ret } = await request({ url: 'simi/artist', params })
        return ret
    },
    // 搜索
    async search(params) {
        const { data: ret } = await request({ url: 'cloudsearch', params })
        return ret
    },
    // 获取歌单明细
    async getPlayList(params) {
        const { data: ret } = await request({ url: 'playlist/detail', params })
        return ret
    },
    // 获取歌单评论
    async playListCom(params) {
        const { data: ret } = await request({ url: 'comment/playlist', params })
        return ret
    },
    // 喜欢音乐
    async likeMusic(params) {
        const { data: ret } = await request({ url: 'like', params })
        return ret
    },
    // 获取喜欢的歌曲列表
    async likeList(params) {
        const { data: ret } = await request({ url: 'likelist', params })
        return ret
    },
    // 获取视频评论
    async videoCom(params) {
        const { data: ret } = await request({ url: 'comment/video', params })
        return ret
    },
    // 收藏视频列表
    async subMvList(params) {
        const { data: ret } = await request({ url: 'mv/sublist', params })
        return ret
    },
    // 收藏视频
    async subVideo(params) {
        const { data: ret } = await request({ url: 'video/sub', params })
        return ret
    },
    async subMv(params) {
        const { data: ret } = await request({ url: 'mv/sub', params })
        return ret
    },
    // 获取视频播放地址
    async videoUrl(params) {
        const { data: ret } = await request({ url: 'video/url', params })
        return ret
    },
    // 获取相似视频
    async allvideo(params) {
        const { data: ret } = await request({ url: 'related/allvideo', params })
        return ret
    },
    // 获取视频基础信息
    async videoDetail(params) {
        const { data: ret } = await request({ url: 'video/detail', params })
        return ret
    },
    // 点赞
    async like(params) {
        const { data: ret } = await request({ url: 'resource/like?t=1', params })
        return ret
    },
    // 收藏专辑
    async subAlb(params) {
        const { data: ret } = await request({ url: 'album/sub', params })
        return ret
    },
    // 查看收藏的专辑
    async subAlbList(params) {
        const { data: ret } = await request({ url: 'album/detail/dynamic', params })
        return ret
    },
    // 收藏歌单
    async subList(params) {
        const { data: ret } = await request({ url: 'playlist/subscribe', params })
        return ret
    },
    // 查看收藏的歌单列表
    async subListData(params) {
        const { data: ret } = await request({ url: 'playlist/detail/dynamic', params })
        return ret
    },
    // 分享
    async share(params) {
        const { data: ret } = await request({ url: 'share/resource', params })
        return ret
    },
    // 电话登录
    async login(params) {
        const { data: ret } = await request({ method: 'POST', url: 'login/cellphone', params })
        return ret
    },
    // 登出
    async logout(params) {
        const { data: ret } = await request({ url: 'logout', params })
        return ret
    },
    // 获取MV排行
    async mvRank(params) {
        const { data: ret } = await request({ url: 'top/mv', params })
        return ret
    },
    // 默认搜索关键词
    async defSearch(params) {
        const { data: ret } = await request({ url: 'search/default', params })
        return ret
    },
    // 热搜列表
    async searchHot(params) {
        const { data: ret } = await request({ url: 'search/hot', params })
        return ret
    },
    // 搜索建议
    async searchSug(params) {
        const { data: ret } = await request({ url: 'search/suggest', params })
        return ret
    },
    // 音乐评论
    async musicCom(params) {
        const { data: ret } = await request({ url: 'comment/music', params })
        return ret
    },
    // 获取歌曲详情
    async musicItem(params) {
        const { data: ret } = await request({ url: 'song/detail', params })
        return ret
    },
    // 获取歌词
    async lyric(params) {
        const { data: ret } = await request({ url: 'lyric', params })
        return ret
    },
    // 获取相似音乐
    async simiSong(params) {
        const { data: ret } = await request({ url: 'simi/song', params })
        return ret
    },
    // 全部mv
    async allMv(params) {
        const { data: ret } = await request({ url: 'mv/all', params })
        return ret
    },
    // 获取最新MV
    async firstMv(params) {
        const { data: ret } = await request({ url: 'mv/first', params })
        return ret
    },
    // 获取推荐MV
    async perMv(params) {
        const { data: ret } = await request({ url: 'personalized/mv', params })
        return ret
    },
    // 获取网易mv
    async wxMv(params) {
        const { data: ret } = await request({ url: 'mv/exclusive/rcmd', params })
        return ret
    },
    // 获取视频标签列表
    async gropuList(params) {
        const { data: ret } = await request({ url: 'video/group/list', params })
        return ret
    },
    // 获取视频分类列表
    async categoryList(params) {
        const { data: ret } = await request({ url: 'video/category/list', params })
        return ret
    },
    // 获取视频标签/分类下的视频
    async videoGroup(params) {
        const { data: ret } = await request({ url: 'video/group', params })
        return ret
    },
    // 获取推荐视频
    async recVideo(params) {
        const { data: ret } = await request({ url: 'video/timeline/recommend', params })
        return ret
    },
    // 歌手分类列表
    async arList(params) {
        const { data: ret } = await request({ url: 'artist/list', params })
        return ret
    },
    // 精品歌单标签列表
    async playListTags(params) {
        const { data: ret } = await request({ url: 'playlist/highquality/tags', params })
        return ret
    },
    // 获取精品歌单
    async topPlayList(params) {
        const { data: ret } = await request({ url: 'top/playlist', params })
        return ret
    },
    // 获取每日推荐歌单
    async recResource(params) {
        const { data: ret } = await request({ url: 'recommend/resource', params })
        return ret
    },
    // 获取每日推荐歌曲
    async recSongs(params) {
        const { data: ret } = await request({ url: 'recommend/songs', params })
        return ret
    },
    // 获取所有排行榜
    async topList(params) {
        const { data: ret } = await request({ url: 'toplist', params })
        return ret
    },
    // 获取轮播
    async banner(params) {
        const { data: ret } = await request({ url: 'banner', params })
        return ret
    },
    // 获取推荐歌单
    async personalized(params) {
        const { data: ret } = await request({ url: 'personalized', params })
        return ret
    },
    // mv 评论
    async comMv(params) {
        const { data: ret } = await request({ url: 'comment/mv', params })
        return ret
    },
    // 获取点赞转发评论数数据
    async detailInfo(params) {
        const { data: ret } = await request({ url: 'mv/detail/info', params })
        return ret
    },
    // 获取用户歌单
    async userPlayList(params) {
        const { data: ret } = await request({ url: 'user/playlist', params })
        return ret
    },
    // 添加歌曲到歌单
    async addList(params) {
        const { data: ret } = await request({ url: 'playlist/tracks', params })
        return ret
    },
    // 创建歌单
    async createList(params) {
        const { data: ret } = await request({ url: 'playlist/create', params })
        return ret
    },
    // 更新歌单描述
    async updateDesc(params) {
        const { data: ret } = await request({ url: 'playlist/desc/update', params })
        return ret
    },
    // 更新歌单名
    async updateName(params) {
        const { data: ret } = await request({ url: 'playlist/name/update', params })
        return ret
    },
    // 歌单封面上传
    async updateImg(params) {
        const { data: ret } = await request({
            method: 'POST',
            url: 'playlist/cover/update',
            headers: {
                'Content-Type': 'multipart/form-data',
            },
            data: params.imgFile,
            params,
        })
        return ret
    },
    // 删除歌单
    async delSongList(params) {
        const { data: ret } = await request({
            url: 'playlist/delete',
            params,
        })
        return ret
    },
    // 云盘
    async could(params) {
        const { data: ret } = await request({
            url: 'user/cloud',
            params,
        })
        return ret
    },
    // 获取用户详情
    async userItem(params) {
        const { data: ret } = await request({
            url: 'user/detail',
            params,
        })
        return ret
    },
    // 二维码 key 生成接口
    async getKey() {
        const { data: ret } = await request({
            url: 'login/qr/key',
        })
        return ret
    },
    // 二维码生成接口
    async createQrCode(params) {
        const { data: ret } = await request({
            url: 'login/qr/create',
            params,
        })
        return ret
    },
    // 查询扫码状态
    async scanQr(params) {
        const { data: ret } = await request({
            url: 'login/qr/check',
            params,
        })
        return ret
    },
    // 获取用户信息
    async getUserInfo(params) {
        const { data: ret } = await request({
            url: 'user/account',
            params,
        })
        return ret
    },
    // 更新用户信息
    async editUser(params) {
        const { data: ret } = await request({
            url: 'user/update',
            params,
        })
        return ret
    },
    // 更新用户头像
    async editPic(params) {
        const { data: ret } = await request({
            method: 'POST',
            url: 'avatar/upload',
            headers: {
                'Content-Type': 'multipart/form-data',
            },
            data: params.imgFile,
            params,
        })
        return ret
    },
    // 重复昵称检测
    async checkNickName(params) {
        const { data: ret } = await request({
            url: 'nickname/check',
            params,
        })
        return ret
    },
    // 获取用户关注列表
    async userFollows(params) {
        const { data: ret } = await request({
            url: 'user/follows',
            params,
        })
        return ret
    },
    // 获取关注我的人
    async userFolloweds(params) {
        const { data: ret } = await request({
            url: 'user/followeds',
            params,
        })
        return ret
    },
    // 关注用户或者取消关注用户
    async follow(params) {
        const { data: ret } = await request({
            url: 'follow',
            params,
        })
        return ret
    },
    //获取用户播放记录
    async recentSong(params) {
        const { data: ret } = await request({
            url: 'user/record',
            params
        })
        return ret
    },
    //听歌打卡
    async scrobble(params) {
        const { data: ret } = await request({
            url: 'scrobble',
            params
        })
        return ret
    },
    //获取动态
    async userEvent(params) {
        const { data: ret } = await request({
            url: 'user/event',
            params
        })
        return ret
    }
}


// export const addUserList = (params) => request({ url: '/users', params })